Channel: ExcelVbaIsFun
Category: Education
Tags: excel tutorialreportshow todatathisworkbookeasy visual basicrangetrainingvba excelcomputerms excelmicrosoft visual basicvisual basiceasy exceltutorialfreereportingprogrammingeasy vbamacrodebuglessonms excel vbaexcelexcel basicsvbaexcel visual basicvba tutorialhdexcel vbavba basicsvisual basic tutorialobject
Description: Hey everybody Dan Strong here with Excel VBA Is Fun this week we had a question, "how do you take a text box and only allow it to do numbers and also a decimal place (and also the negative sign but nothing else)?" So we're going to dive into how to allow numbers and decimals only to Textboxes in Excel VBA. It's actually very easy. First, we'll make and set up a quick Userform to test on. This video includes a thorough look at the KeyDown event and its parameters, so hopefully you're taking notes! We'll also review these topics in the video: Limiting numbers using KeyCode Constants, Allowing Subtract and Decimal keys, How to disable any keystroke, Number pad keys vs regular keys, How to figure out a keycode the easy way, Determine whether Shift key is held down, Adding Enter/Return key - and lots more! If you have any questions, please leave comments below. 🟡Download Workbook: excelvbaisfun.com/sdm_downloads/how-to-allow-numbers-and-decimals-only-to-textboxes-userform Get My Bestselling Excel VBA Courses: Excel VBA Essentials Course: bit.ly/UltExcelVBA Control Websites With Excel VBA: bit.ly/VbaWebAutomation Speed Up Code With VBA Arrays: bit.ly/VbaArrays Create Your Own Functions/Addins: bit.ly/CustomUDFsAddins Fill PDFs/Forms with Excel VBA: bit.ly/VbaPDFsMastery Excel VBA Barcode Lookup System & Inventory Projects: bit.ly/VbaBarcodesProjects Instantly Secure Excel Files; Transform Into EXE Programs!: bit.ly/Excel2EXE Automate Outlook with Excel VBA: bit.ly/ExcelVBAOutlook 00:00 Intro 00:18 Make & Set-Up Userform 00:58 Looking at Textbox Events 01:08 KeyDown Event Method 02:28 Limiting numbers using KeyCode Constants 02:53 Allowing Subtract and Decimal keys 03:58 How to disable any keystroke 04:30 Number pad keys vs regular keys 06:00 How to figure out a keycode the easy way 06:55 Determine whether Shift key is held down 08:00 Adding Enter/Return key, etc Fantastic Developer Tools: Lock Any Workbook Into An EXE (Software only, see course above): excelvbaisfun.com/get-xlspadlock Create Custom Installers: excelvbaisfun.com/get-pb Free Ebook: excelvbaisfun.com/FreeEbook Dan Strong's Articles: excelvbaisfun.com/blog Free Excel Workbooks: excelvbaisfun.com/free-workbooks Business Inquiries, Consulting, Comments, etc: excelvbaisfun.com/contact ExcelVbaIsFun YouTube Playlists: Excel Vba Basics: bit.ly/ExcelVbaBasicsPlaylist Tips N Tricks: bit.ly/VbaTipsNTricksPlaylist Userforms: bit.ly/ExcelVbaUserformsPlaylist Events Series: bit.ly/VbaEventsPlaylist Activex Controls: bit.ly/VbaActiveXPlaylist Sample Excel Programs: bit.ly/SampleExcelPrograms Where else you can find me: LinkedIn: linkedin.com/in/danielcstrong Facebook: facebook.com/Excelvbaisfun Twitter: twitter.com/ExcelVbaIsFun Google Plus+: google.com/+ExcelVbaIsFun T-Shirts/Merch: ExcelVbaIsFun.spreadshirt.com 'Royalty Free Music by audiomicro.com/royalty-free-music' #ExcelVbaIsFun #DanStrong #ActiveX